﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Administrator/MasterPage.master" AutoEventWireup="false" CodeFile="HisToryLogin.aspx.vb" Inherits="Administrator_HisToryLogin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <script type="text/javascript">
                $(document).ready(function () {

                    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                    $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                        yearAddToDisplay: 543,
                        dateFormat: 'dd/mm/yy',
                        showOn: "button",
                        buttonImage: "../img/calendar.gif",
                        buttonImageOnly: true
                    }));
                    $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                        yearAddToDisplay: 543,
                        dateFormat: 'dd/mm/yy',
                        showOn: "button",
                        buttonImage: "../img/calendar.gif",
                        buttonImageOnly: true
                    }));
                    function EndRequestHandler(sender, args) {
                        $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                            yearAddToDisplay: 543,
                            dateFormat: 'dd/mm/yy',
                            showOn: "button",
                            buttonImage: "../img/calendar.gif",
                            buttonImageOnly: true
                        }));
                        $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                            yearAddToDisplay: 543,
                            dateFormat: 'dd/mm/yy',
                            showOn: "button",
                            buttonImage: "../img/calendar.gif",
                            buttonImageOnly: true
                        }));

                    }

                });
    </script>
            <table style="width:100%;" class="control">
                <tr>
                    <td style="text-align: right">
                        ฝ่าย :</td>
                    <td style="text-align: left; width: 173px;">
                        <asp:DropDownList ID="ddlDepartment" runat="server" AutoPostBack="True" 
                            CssClass="control" Width="196px">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right; width: 93px;">
                        ส่วนงาน/สาขา :</td>
                    <td style="text-align: left; width: 216px;">
                        <asp:DropDownList ID="ddlBranch" runat="server" CssClass="control" 
                            Width="183px">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right" width="120">
                        <span ID="ContentPlaceHolder1_lblUserRight" class="control">กลุ่มสิทธิ์</span>&nbsp;:</td>
                    <td style="text-align: left">
                        <asp:DropDownList ID="ddlUserRight" runat="server" CssClass="control" 
                            Width="150px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        &nbsp; รหัสผู้ใช้งาน :</td>
                    <td style="text-align: left; width: 173px;">
                        <asp:TextBox ID="txtUsername" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="5" Width="150px"></asp:TextBox>
                    </td>
                    <td style="text-align: right; width: 93px;">
                        ชื่อผู้ใช้งาน :</td>
                    <td style="text-align: left; width: 216px;">
                        <asp:TextBox ID="txtFirstName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="100" Width="200px"></asp:TextBox>
                    </td>
                    <td style="text-align: right" width="120">
                        นามสกุลผู้ใช้งาน :</td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtLastName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="100" Width="180px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        วันที่ :</td>
                    <td style="text-align: left; width: 173px;">
                        <asp:TextBox ID="txtStartDate" runat="server" Height="20px" 
                            AutoCompleteType="Disabled"></asp:TextBox>
                    </td>
                    <td style="text-align: right; width: 93px;">
                        ถึง</td>
                    <td style="text-align: left; width: 216px;">
                        <asp:TextBox ID="txtEndDate" runat="server" Width="150px" Height="20px" 
                            AutoCompleteType="Disabled"></asp:TextBox>
                    </td>
                    <td style="text-align: right" width="120">
                        &nbsp;</td>
                    <td style="text-align: left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        <asp:Label ID="lblLoginType" runat="server" CssClass="control"></asp:Label>
                        &nbsp;:</td>
                    <td colspan="5" style="text-align: left; ">
                        <asp:CheckBox ID="chkIsLoginPass" runat="server" Checked="True" CssClass="control" 
                            Text="เข้าใช้ระบบ" />
                        &nbsp;<asp:CheckBox ID="chkLogout" runat="server" Checked="True" CssClass="control" 
                            Text="ออกจากระบบ" />
                        &nbsp;<asp:CheckBox ID="chkLoginFalse" runat="server" Checked="True" 
                            CssClass="control" Text="เข้าใช้งานไม่สำเร็จ" />
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: right">
                        
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="search" 
                            Width="80px" />
                        <asp:Button ID="btnPrint" runat="server" CssClass="control" Text="Print" 
                            Width="80px" />
                    </td>
                </tr>
              
            </table>
            <div align="center">
            <asp:Label ID="lblMsg" runat="server" CssClass="control" Font-Size="XX-Large" 
                            ForeColor="Red" Height="30px" Visible="False"></asp:Label>
            <asp:GridView ID="gvLogLogin" runat="server" AllowSorting="True" 
                            AutoGenerateColumns="False" CellPadding="4" CssClass="control" 
                            ForeColor="#333333" Width="100%" AllowPaging="True">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <FooterStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                                      CssClass="cssPager" />
                            <SelectedRowStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="userName" HeaderText="รหัสผู้ใช้งาน" ReadOnly="True" 
                                    SortExpression="userName">
                                <ItemStyle HorizontalAlign="Left" Width="100px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="ชื่อ-นามสกุล">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" 
                                            Text='<%# eval("EmpName") & " " & eval("EmpLastName") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" Width="150px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="LoginTypeName" HeaderText="ประเภท" ReadOnly="True" 
                                    SortExpression="LoginTypeName">
                                <ItemStyle HorizontalAlign="Left" Width="120px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="LoginDate" HeaderText="วันที่" 
                                    SortExpression="LoginDate" >
                                <ItemStyle HorizontalAlign="Left" Width="150px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="LastIP" HeaderText="IP เข้าใช้งาน">
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="DeptName" HeaderText="ฝ่าย" />
                                <asp:BoundField DataField="BranchName" HeaderText="ส่วนงาน/สาขา" />
                            </Columns>
                        </asp:GridView>
            </div>
            <div align="right">
                   <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
             </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

